<!-- 进群领券 -->
<template>
	<view class="JoinGroup">
		<image class="group pof" :src="`${OnlineStatic}bei.png`" mode="widthFix"></image>
		<view class="group-title dis por font-weight-600 color-f">加入“{{village.communityName || '请绑定小区'}}”邻里群</view>
		<view class="visible-area por">
			<image class="width-height100" :src="`${OnlineStatic}${options.type*1 != 2 ? `kuang` : `kuangs`}.png`"
				mode=""></image>
			<view class="visible-rong poa width100">
				<view class="rong" :class="{'rongs' : options.type*1 == 2}">
					<image class="width-height100" :src="infoCode.qrCodeUrl" mode=""></image>
				</view>
				<view class="button dis">
					<text class="color font-weight-600 size-30">长按识别二维码</text>
				</view>
			</view>
			<image class="shou" :src="`${OnlineStatic}shou.png`" mode=""></image>
		</view>
	</view>
</template>

<script>
	import { OnlineStatic, GetQrCodeById } from "@/api/index"
	export default {
		data() {
			return {
				OnlineStatic,
				village: {},
				options: {},
				infoCode: {}
			}
		},
		onShow() {
			this.village = uni.getStorageSync('village')
		},
		onLoad(options) {
			this.options = options
			this.postGetQrCodeById(options.type)
		},
		methods: {
			async postGetQrCodeById(qrCodeType) {
				const params = {
					qrCodeType: qrCodeType*1, // 二维码类型 1.小区二维码 2.进群二维码
					communityId: uni.getStorageSync('village').id
				}
				const { data, code } = await GetQrCodeById(params)
				if (code == '200') {
					this.infoCode = data
				}
			}
		}
	}
</script>

<style lang="scss">
	.JoinGroup {
		background: #FF3030;

		.group {
			width: 100vw;
			height: 100vh;
			bottom: 0;
			left: 0;
		}

		.group-title {
			height: 244rpx;
			font-size: 56rpx;
			line-height: 68rpx;
			width: 660rpx;
			margin: 0 auto;
			text-align: center;
		}

		.visible-area {
			width: 630rpx;
			height: 770rpx;
			z-index: 10;
			margin: 0 auto;
			position: relative;
		}

		.button {
			width: 316rpx;
			height: 78rpx;
			border-radius: 100rpx;
			margin: 0 auto 32rpx;
			background: rgba(255, 210, 210, 0.73);
		}

		.shou {
			width: 234rpx;
			height: 342rpx;
			position: fixed;
			right: 0;
			top: 46vh;
		}

		.rong {
			width: 324rpx;
			height: 324rpx;
			margin: 0 auto 57rpx;
		}

		.rongs {
			margin: 0 auto 84rpx;
		}

		.visible-rong {
			bottom: 0;
			left: 0;
		}
	}
</style>